home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
vap.arc
/
VAP.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-05-03
|
5KB
|
243 lines
;*****************************************************************************
;*
;* Program Name: VAP_PRIMITIVES
;*
;* Filename: vap.asm (SVAP.LIB)
;*
;* Version: 1.0
;*
;* Programmers: Bryan Sparks
;*
;* Comments: This file is a library of calls defined for the VAP
;* interface. Written in MASM 4.0 and assuming SMALL
;* MSC 4.0 C code (or MSC 5.0).
;*
;*****************************************************************************
name VAPLibraryModule
PGroup group _TEXT
assume cs: PGroup
_TEXT segment public 'CODE'
public _VAllocateSegment
public _VChangeToDataSegment
public _VSpawnProcess
public _VInitializationComplete
public _VKillProcess
public _VChangeProcess
public _VDelayProcess
public _VSleepProcess
public _VWakeUpProcess
public _VConsoleError
public _VGetProcessID
public _SetEStoDS
public _VAPAttachToFileServer
extrn ProcessControlServices: dword
AllocateSegment equ 0
ChangeToDataSegment equ 1
ChangeSegmentToCode equ 2
DeclareSegmentAsData equ 3
DeclareExtendedSegment equ 4
SpawnProcess equ 5
SetPassThroughShellMode equ 6
InitializationComplete equ 7
KillProcess equ 8
ChangeProcess equ 9
DelayProcess equ 10
GetProcessID equ 11
SleepProcess equ 12
WakeUpProcess equ 13
SetHardwareInterruptVector equ 14
GetInterruptVector equ 15
SetInterruptVector equ 16
CalculateAbsoluteAddress equ 17
SetExtendedProcessorError equ 18
ConsoleError equ 19
GetFileServerName equ 20
AttachToFileServer equ 21
MapFileServerNameToNumber equ 22
_VAllocateSegment:
push bp
mov bp, sp
mov ax, [bp + 2 + 2] ; paragraph amount
mov di, AllocateSegment
push es
jmp ProcessControlServicesCALL
_VChangeToDataSegment:
push bp
mov bp, sp
mov ax, [bp + 2 + 2] ; segment value
mov di, ChangeToDataSegment
push es
jmp ProcessControlServicesCALL
_VSpawnProcess:
push bp
mov bp, sp
mov cx, [bp + 2 + 2] ; process entry
mov dx, ds ; process data segment
mov bx, cs ; assume near
mov bp, cs
mov di, SpawnProcess
push es
jmp ProcessControlServicesCALL
_VInitializationComplete:
push bp
mov di, InitializationComplete
push es
jmp ProcessControlServicesCALL
_VKillProcess:
push bp
mov di, KillProcess
push es
jmp ProcessControlServicesCALL
_VChangeProcess:
push bp
mov di, ChangeProcess
push es
jmp ProcessControlServicesCALL
_VDelayProcess:
push bp
mov bp, sp
mov dx, [bp + 2 + 2] ;delay amount
mov di, DelayProcess
push es
jmp ProcessControlServicesCALL
_VSleepProcess:
push bp
mov di, SleepProcess
push es
jmp ProcessControlServicesCALL
_VWakeUpProcess:
push bp
mov bp, sp
mov bx, [bp + 2 + 2] ; sleeping process ID
mov di, WakeUpProcess
push es
jmp ProcessControlServicesCALL
_VConsoleError:
push bp
mov bp, sp
mov si, [bp + 2 + 2] ; display error on console
mov di, ConsoleError
push es
jmp ProcessControlServicesCALL
_VGetProcessID:
push bp
push es
mov di, GetProcessID
ProcessControlServicesCALL proc near
call dword ptr cs:ProcessControlServices
pop es
pop bp
ret
ProcessControlServicesCALL endp
_VAPAttachToFileServer proc near
push bp
mov bp, sp
mov ax, [bp+4]
mov si, ax
mov di, 15h
call dword ptr cs:ProcessControlServices
xor ah, ah
xor dh, dh
mov si, [bp+6]
mov [si], dx
pop bp
ret
_VAPAttachToFileServer endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ConsoleControlServices Calls
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
public _VClearScreen
public _VPrintString
public _VReadKeyboard
public _Interrupt3
extrn ConsoleControlServices: dword
_Interrupt3 proc near
int 3
_Interrupt3 endp
_VClearScreen proc near
push bp
mov bp, sp
mov di, 0 ;0 is ClearScreen
call dword ptr cs:ConsoleControlServices
pop bp
ret
_VClearScreen endp
_VPrintString proc near
push bp
mov bp, sp
mov ax, [bp + 2 + 8]
push ax
push ds
mov ax, [bp + 2 + 6]
push ax
mov ax, [bp + 2 + 4]
push ax
mov ax, [bp + 2 + 2]
push ax
mov di, 1
call dword ptr cs:ConsoleControlServices
mov sp, bp
pop bp
ret
_VPrintString endp
_VReadKeyboard proc near
push bp
mov bp, sp
mov ax, [bp + 2 + 4]
push ax
push ds
mov ax, [bp + 2 + 2]
push ax
mov di, 2
call dword ptr cs:ConsoleControlServices
mov sp, bp
pop bp
ret
_VReadKeyboard endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Misc Calls
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_SetEStoDS proc near
push ds
pop es
ret
_SetEStoDS endp
_TEXT ends
end